import errorImage from '@/assets/images/error/404.svg'
import styles from './index.module.scss'
import { Button } from 'antd'
import { useNavigate, useLocation } from "react-router-dom";
function Error () {
    const navigate = useNavigate();
    const location = useLocation();
    const goBack = () => {
        if(location.state && location.state.from){
            navigate(-1);
        } else {
            navigate('/')
        }
    }
    return (<div className={styles['error']}>
        <div>
            <img className={styles['img']} src={errorImage} alt="" srcSet="" width={500}/>
            <Button type="primary" onClick={goBack}>返 回</Button>
        </div>
    </div>)
}

export default Error;